<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends HomeAction {
	
    public function qiniu(){ 
        if(IS_POST){
            import('Com.Qiniu.Qiniu');
            $fileName = $_FILES['upload']['tmp_name'];
            $originName = $_FILES['upload']['name'];
            $config = [
                'Access_Key' =>'C4nxETVFR6VucLtctT7GfwDGTMKJLnySebZBcqUm',
                'Secret_Key' =>'oVG0zsdSt72mgqh0dSg8fWjjiYCa_5M6UUZJejNa',
                'Bucket_Name' =>'vxintp'
            ];
            //dump($_FILES);exit;
            $Qiniu = new Qiniu($config);
            $rst = $Qiniu ->upload($fileName,$originName);
            dump($rst);
        }else{
            $this->display();
        }


    }
	 public function uploadify(){
	  
	  $this->display();
   }
    public function apiSentMsg(){

        var_dump(sendMsg('15907185954','这是一条测试的短信'));
    }
	public function query(){
		$url = 'http://mp.weixin.qq.com/s?__biz=MzA3MDE0NDEzNQ==&mid=2650817518&idx=3&sn=ce1214310a15672d17cc88a04d0ef834&scene=1&srcid=0611SFDs6GCHsKf8MWgDOsHv&from=singlemessage&isappinstalled=0#wechat_redirect';
        $content1 = http($url,'');
        preg_match('/\/mp\/newappmsgvote\?action=show\&amp\;__biz=(.*)\#/',$content1,$match);
        if(!$match){
            $this->ajaxReturn(0,'您填写的地址有误',0);
        }
        //拼接url
        $apiUrl = 'http://mp.weixin.qq.com/mp/newappmsgvote?action=show&__biz=';
        $param = str_replace('&amp;','&',$match[1]);
        $apiUrl.=$param;
        $content2 = http($apiUrl,'');
        preg_match("/voteInfo=(.*)\;/",$content2,$match2);
        if(!$match2){
            $this->ajaxReturn(0,'没有找到相关信息',0);
        }
        $this->ajaxReturn($match2[1],1,1);
	}
	

}